package org.dxy.trigger.http.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.dxy.api.dto.request.*;
import org.dxy.api.response.R;
import org.dxy.infrastructure.entity.query.WorkOrderViewEntity;

/**
 * 工单应用服务接口
 */
public interface WorkOrderApplicationService {
    
    /**
     * 创建工单
     */
    R<Long> create(CreateWorkOrderRequest request);
    
    /**
     * 下达工单
     */
    R<Void> release(Long workOrderId);
    
    /**
     * 开始工单
     */
    R<Void> start(Long workOrderId);
    
    /**
     * 暂停工单
     */
    R<Void> suspend(Long workOrderId, SuspendWorkOrderRequest request);
    
    /**
     * 恢复工单
     */
    R<Void> resume(Long workOrderId);
    
    /**
     * 完成工单
     */
    R<Void> complete(Long workOrderId, CompleteWorkOrderRequest request);
    
    /**
     * 关闭工单
     */
    R<Void> close(Long workOrderId, CloseWorkOrderRequest request);
    
    /**
     * 取消工单
     */
    R<Void> cancel(Long workOrderId, CancelWorkOrderRequest request);
    
    /**
     * 分页查询工单列表
     */
    R<Page<WorkOrderViewEntity>> list(Page<WorkOrderViewEntity> page, WorkOrderViewEntity query);
    
    /**
     * 根据ID查询工单详情
     */
    R<WorkOrderViewEntity> getById(Long workOrderId);
    
    /**
     * 根据状态查询工单列表
     */
    R<Page<WorkOrderViewEntity>> getByStatus(Page<WorkOrderViewEntity> page, String status);
    
    /**
     * 更新工单
     */
    R<Void> update(Long workOrderId, CreateWorkOrderRequest request);
    
    /**
     * 删除工单
     */
    R<Void> delete(Long workOrderId);
    
    /**
     * 批量删除工单
     */
    R<Void> batchDelete(java.util.List<Long> ids);
}